home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 60267 / 60267.xpi / content / overlay.js < prev    next >
Text File  |  2010-01-14  |  1KB  |  29 lines

  1. function boredomButtonDown() {
  2.     content.wrappedJSObject.location = 'http://www.boredombutton.com/?ref=ff';
  3. }
  4.  
  5. function boredomButtonSetup(){
  6.     try {
  7.         var firefoxnav = document.getElementById("nav-bar");
  8.         var curSet = firefoxnav.currentSet;
  9.         if (curSet.indexOf("boredombutton-toolbar-button") == -1) {
  10.             var set;
  11.             // Place the button before the urlbar
  12.             if (curSet.indexOf("urlbar-container") != -1)
  13.                 set = curSet.replace(/urlbar-container/, "boredombutton-toolbar-button,urlbar-container");
  14.             else  // at the end
  15.                 set = curSet + ",boredombutton-toolbar-button";
  16.             firefoxnav.setAttribute("currentset", set);
  17.             firefoxnav.currentSet = set;
  18.             document.persist("nav-bar", "currentset");
  19.             // If you don't do the following call, funny things happen
  20.             try {
  21.                 BrowserToolboxCustomizeDone(true);
  22.             }
  23.             catch (e) { }
  24.         }
  25.     }
  26.     catch (e) { } 
  27. }
  28.  
  29. window.addEventListener("load", function(e) { boredomButtonSetup(); }, false);